home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / source / xdme_1.84_src.lha / XDME / Src / Mod / Messages.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-12  |  2.7 KB  |  90 lines

  1.  
  2. /******************************************************************************
  3.  
  4.     MODULE
  5.     Messages.c
  6.  
  7.     DESCRIPTION
  8.     XDME User Dialogs Module
  9.  
  10.     The Messages module shall support automatically
  11.     generated lists of strings, externally accessible
  12.     via a "const char ..." directive, in order to be
  13.     able to add Locale support for XDME
  14.  
  15.     the way to produce that list is:
  16.     * each used string must be named and put into a DEFMESSAGE-Makro,
  17.      e.g.
  18.       $ DEFMESSAGE(__hello_world, "Hello world!\n")
  19.       $    error(__hello_world);
  20.      instead of just
  21.       $    error("Hello world!");
  22.     * from CLI/Make commands like the following must be performed:
  23.       > GREP -h ^DEFMESSAGE ...>t:messages.1
  24.       (we are using EXTRACTER (included in the Package) instead)
  25.       > SORT from t:messages.1  t:messages.2
  26.       (Workbench supports a SORT command)
  27.       > UNIQ      t:messages.1 >include/messages.h
  28.       (UNIQ will be included into XDME; there are many implementations around)
  29.       > DELETE    t:messages.?
  30.       (Workbench supports a DELETE command)
  31.      that way we do generate a list of all used strings
  32.     * lines like the following must be added to a global include file
  33.       $ #undef  DEFMESSAGE
  34.       $ #define DEFMESSAGE(name,value) extern char *name;
  35.       $ #include  "messages.h"
  36.       $ #undef  DEFMESSAGE
  37.       $ #define DEFMESSAGE(name,value)
  38.     * the file "messages.c" must be added to the Source tree;
  39.       the dependency
  40.       $(OBJDIR)messages.o : $(SRCDIR)messages.c $(InCDIR)messages.h
  41.       must be added to the Makefile.
  42.  
  43.     NOTES
  44.     there is currently no way to ensure the order of
  45.     the used strings, for that reason, we have not yet
  46.      decided how to create a stable Locale-catalog.
  47.      for the same reason, this mdule does currently not
  48.      call any function, it just exports some strings...
  49.  
  50.     BUGS
  51.     since uniq does check full lines, there is currently no
  52.     gurantee, that no symbol is defined twice, so compilation
  53.     for the module might fail; in such a case, user must search
  54.     in $(INCDIR)messages.h for duplicate names and change them
  55.     in their defining Files manually...
  56.  
  57.     TODO
  58.     tell me
  59.  
  60.     EXAMPLES
  61.  
  62.     SEE ALSO
  63.     Command.c (similar mechanism is used to create the Commandtree)
  64.     Vars.c      (same mechanism is used to build the List of vartrees)
  65.  
  66.     INDEX
  67.  
  68.     HISTORY
  69.     01-10-94 b_noll created
  70.  
  71. ******************************************************************************/
  72.  
  73.  
  74. /**************************************
  75.           Includes
  76. **************************************/
  77.  
  78.  
  79. /**************************************
  80.         Global Variables
  81. **************************************/
  82.  
  83. #define DEFMESSAGE(n,v) const char *(n) = (v);
  84. #include "gen_messages.h"
  85.  
  86. /******************************************************************************
  87. *****  END Messages.c
  88. ******************************************************************************/
  89.  
  90.